﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Runtime.InteropServices;
using SCOSub.FFMS2;

namespace SCOSub
{
    public partial class VisualStaffMaker : Form
    {
        public delegate void ShowMainFormHandle();
        public event ShowMainFormHandle ShowMainForm;
        VisualStaffMaker_VideoPlayer videoplayer;
        VisualStaffMaker_TextBox textbox;
        public VisualStaffMaker()
        {
            InitializeComponent();
        }

        private void VisualStaffMaker_FormClosing(object sender, FormClosingEventArgs e)
        {
            ShowMainForm();
        }

        private void opentoolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (DialogResult.OK != openFileDialog1.ShowDialog())
                return;
            videoplayer = new VisualStaffMaker_VideoPlayer();
            videoplayer.Owner = this;
            opentoolStripMenuItem.Enabled = false;
            //videoplayer.PlayClose += new VisualStaffMaker_VideoPlayer.PlayerCloseHandle(videoplayer_PlayClose);
            videoplayer.Show();
            videoplayer.OpenFile(openFileDialog1.FileName);
        }

        private void 打开字幕ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            /*if (DialogResult.OK != openFileDialog2.ShowDialog())
                return;
            textbox = new VisualStaffMaker_TextBox(openFileDialog2.FileName);
            textbox.TextChanged += new EventHandler(textbox_TextChanged);
            textbox.Owner = this;

            textbox.Show();*/
        }



        private void videoplayer_PlayClose()
        {
            opentoolStripMenuItem.Enabled = true;

        }
        void textbox_TextChanged(object sender, EventArgs e)
        {
            // videoplayer.reloadcurrentframe(); MessageBox.Show("read");
        }

     
    }
}

